package org.example.ui;

import javax.swing.*;
import java.awt.*;

public class LoadingPanel extends JPanel {
    public LoadingPanel() {
        SpringLayout layout = new SpringLayout();
        setLayout(layout);
        JLabel label = new JLabel();
        Image image = new ImageIcon("data/background/loading.gif").getImage().
                getScaledInstance(200, 200, Image.SCALE_DEFAULT);
        label.setIcon(new ImageIcon(image));
        add(label);
        setBackground(null);
        setOpaque(true);
        layout.putConstraint(SpringLayout.HORIZONTAL_CENTER, label, 0, SpringLayout.HORIZONTAL_CENTER, this);
        layout.putConstraint(SpringLayout.VERTICAL_CENTER, label, 0, SpringLayout.VERTICAL_CENTER, this);
    }
}
